<?php

namespace App\Models\Oauth;

use Illuminate\Support\Facades\DB;
use App\Models\Model;

/**
 * 用户类型模型
 */
class UserTypeModel extends Model
{

    const TABLENAME = 'tw_base_user_type';

    /**
     * 初始化并返回数据库请求构建器
     *
     * @return Illuminate\Support\Facades\DB::table(TABLENAME)
     */
    public static function dbTable()
    {
        return DB::table(self::TABLENAME);
    }

    /**
     * 获取用户类型
     */
    public static function getUserType()
    {
        return self::dbTable()->select(array('id','name'))->orderBy('sort','ASC')->get();
    }

}

?>